class WinMoney extends egret.DisplayObjectContainer {
	money:number;
	private context:any;
	
	public constructor(context:any) {
		  super();
		  this.context = context;
		  this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
	}
  public setMoney(money:number){
    this.money=money;
  }
   private onAddToStage(event:egret.Event) {
		new Bg(this,'mark_in_free_png');
		var percentage = 0.65;

		//加载主面板
		var imgCon = [];
		imgCon['url'] = 'win_money_bg_png';
		imgCon['width'] = this.stage.stageWidth * 0.66;
		imgCon['height'] = this.stage.stageHeight* 0.6;
		imgCon['y'] = this.stage.stageHeight * 0.21;
	    imgCon['x'] = this.stage.stageWidth * 0.17;
		this.addChild(new ImageBitmap(imgCon).getImgPoint());
/**
 * 钱的标志
 */
        var moneySign = [];
        moneySign['url'] = 'money_sign_png';
		moneySign['width'] = this.stage.stageWidth * 0.023;
		moneySign['height'] = this.stage.stageHeight* 0.026 * 1920/1080;
		moneySign['y'] = this.stage.stageHeight * 0.675;
	    moneySign['x'] = this.stage.stageWidth * 0.367;
		this.addChild(new ImageBitmap(moneySign).getImgPoint());

/**
 * 后面一串钱
 */
        var tempNumber:number=this.money;
		var showNumber:number=0;
        var numberlist = Array();
        for(var i=0;i<11;i++){
			showNumber=Math.floor(tempNumber%10);
			numberlist=Array();
			numberlist['url'] = showNumber+'_png';
			numberlist['width'] = this.stage.stageWidth * 0.02;
			numberlist['height'] = this.stage.stageHeight* 0.02 * 1920/1080;
			numberlist['y'] = this.stage.stageHeight * 0.68;
			numberlist['x'] = this.stage.stageWidth * (0.621-i*0.023);
			this.addChild(new ImageBitmap(numberlist).getImgPoint());
			tempNumber = Math.floor(tempNumber/10);
		}

/**
 * 3个探照灯
 */
        var lightRight1 = [];
        lightRight1['url'] = 'light_png';
		lightRight1['width'] = this.stage.stageWidth * 0.25;
		lightRight1['height'] = this.stage.stageHeight* 0.25 * 1920/1080;
		lightRight1['y'] = this.stage.stageHeight * 0.56;
	    lightRight1['x'] = this.stage.stageWidth * 0.60;
		this.addChild(new ImageBitmap(lightRight1).getImgPoint());

        var lightRight2 = [];
        lightRight2['url'] = 'light_png';
		lightRight2['width'] = this.stage.stageWidth * 0.25;
		lightRight2['height'] = this.stage.stageHeight* 0.25 * 1920/1080;
		lightRight2['rotation'] =31;
		lightRight2['y'] = this.stage.stageHeight * 0.41;
	    lightRight2['x'] = this.stage.stageWidth * 0.44;
		this.addChild(new ImageBitmap(lightRight2).getImgPoint());

        var lightRight3 = [];
        lightRight3['url'] = 'light_png';
		lightRight3['width'] = this.stage.stageWidth * 0.25;
		lightRight3['height'] = this.stage.stageHeight* 0.25 * 1920/1080;
		lightRight3['rotation'] = 66;
		lightRight3['y'] = this.stage.stageHeight * 0.44;
	    lightRight3['x'] = this.stage.stageWidth * 0.31;
		this.addChild(new ImageBitmap(lightRight3).getImgPoint());
        // var lightone=new WinMoneyLight();
        // lightone['width'] = this.stage.stageWidth * 0.25;
		// lightone['height'] = this.stage.stageHeight* 0.25 * 1920/1080;
		// lightone['y'] = this.stage.stageHeight * 0.9999;
	    // lightone['x'] = this.stage.stageWidth * 0.83;
		// lightone.anchorOffsetX = lightone.width-this.stage.stageWidth * 0.02;
		// lightone.anchorOffsetY =lightone.height-this.stage.stageWidth * 0.02;
		// this.addChild(lightone);

    }
	


      

	

}